/**
 ******************************************************************************
 * @file    User/js32t0xx_irq.c
 * @author  JUSHENG Application Team
 * @version V1.0.4
 * @date    12-14-2021
 * @brief   This file contains all the Interrupt IRQ firmware functions.
 ******************************************************************************
 * @attention
 *
 * <h2><center>&copy; COPYRIGHT 2021 JUSHENG</center></h2>
 *
 *
 *
 ******************************************************************************
 */

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "js32t031_system.h"
#include "js32t031_irq.h"
#include "tasks.h"
#include "board.h"
#include "433_decoding/433_software_decoding.h"
/** @addtogroup Template_Project
 * @{
 */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/******************************************************************************/
/*            Cortex-M0 Processor Exceptions Handlers                         */
/******************************************************************************/

/**
 * @brief  This function handles NMI exception.
 * @param  None
 * @retval None
 */
void NMI_Handler(void)
{
	
}

/**
 * @brief  This function handles Hard Fault exception.
 * @param  None
 * @retval None
 */
void HardFault_Handler(void)
{
  /* Go to infinite loop when Hard Fault exception occurs */
  while (1)
  {
  }
}

/**
 * @brief  This function handles SVCall exception.
 * @param  None
 * @retval None
 */
void SVC_Handler(void)
{
}

/**
 * @brief  This function handles PendSV_Handler exception.
 * @param  None
 * @retval None
 */
void PendSV_Handler(void)
{
}

/**
 * @brief  This function handles SysTick Handler.
 * @param  None
 * @retval None
 */
void SysTick_Handler(void)
{
  SysTickCnt++;
}

/**
 * @brief  LVD Interrupt handler
 * @param  None.
 * @retval None.
 */
void LVD_IRQHandler(void)
{
}

/**
 * @brief  Uart0 Interrupt handler
 * @param  None.
 * @retval None.
 */
void UART0_IRQHandler(void)
{
}

/**
 * @brief  Uart1 Interrupt handler
 * @param  None.
 * @retval None.
 */
void UART1_IRQHandler(void)
{
  uart_rx_irq_handle();
  // uart_tx_irq_handle();
}

/**
 * @brief  UST Interrupt handler
 * @param  None.
 * @retval None.
 */
void UST_IRQHandler(void)
{
}

/**
 * @brief  SPI0 Interrupt handler
 * @param  None.
 * @retval None.
 */
void SPI0_IRQHandler(void)
{
}

/**
 * @brief  GPIOA Interrupt handler
 * @param  None.
 * @retval None.
 */
void GPIOA_IRQHandler(void)
{
  // hall_irq_handle();
}

/**
 * @brief  GPIOB Interrupt handler
 * @param  None.
 * @retval None.
 */
void GPIOB_IRQHandler(void)
{
}

/**
 * @brief  WKPND Interrupt handler
 * @param  None.
 * @retval None.
 */
void WKPND_IRQHandler(void)
{
}

/**
 * @brief  TIMER0 Interrupt handler
 * @param  None.
 * @retval None.
 */
void TIM0_IRQHandler(void)
{
  // cap_time_interrupt();
  if (LL_TIMER_CNT_PRD_PENDING_GET(TIMER0))
  {
    decode_433();
    led_driver();
    LL_TIMER_CNT_PRD_PENDING_CLR(TIMER0);
  }
}

/**
 * @brief  TIMER1 Interrupt handler
 * @param  None.
 * @retval None.
 */
void TIM1_IRQHandler(void)
{
  if (LL_TIMER_CNT_PRD_PENDING_GET(TIMER1))
  {
    UpdateTimers();
    LL_TIMER_CNT_PRD_PENDING_CLR(TIMER1);
    // ll_gpio_toggle(GPIOB,LL_GPIO_PIN_4);
  }
}

/**
 * @brief  TIMER4 Interrupt handler
 * @param  None.
 * @retval None.
 */
void TIM4_IRQHandler(void)
{
}

/**
 * @brief  ADC Interrupt handler
 * @param  None.
 * @retval None.
 */
void ADC_IRQHandler(void)
{
}

/**
 * @brief  CRC_DMA Interrupt handler
 * @param  None.
 * @retval None.
 */
void CRC_DMA_IRQHandler(void)
{
}

/**
 * @brief  WDT Interrupt handler
 * @param  None.
 * @retval None.
 */
void WDT_IRQHandler(void)
{
}

/**
 * @brief  LCD Interrupt handler
 * @param  None.
 * @retval None.
 */
void LCD_IRQHandler(void)
{
}

/**
 * @}
 */

/*************************** (C) COPYRIGHT 2021 JUSHENG ***** END OF FILE *****/
